#pragma once

#include "Headers.h"
#include "Defines.h"

//Goto Defined Functions to add a new data type

class VectorData
{
private:
	void * Data;
	int Data_Type;
public:
	VectorData():Data(NULL),Data_Type(NULL){}
	VectorData(int DataType,void * Data):Data(Data),Data_Type(DataType){}
	void SetDatawType(void * D,int Type)
	{
		Data = D;
		SetDataType(Type);
	}
	void SetDataType(int Type)
	{
		Data_Type = Data_Type | Type;
		for(int i = 0;i < 8;++i)	
		{
			Data_Type = Data_Type & Type;
		}
	}
	int GetDataType(){return Data_Type;}
	void * GetData()
	{
		return Data;}
};

class Vector
{
private:
	VectorData ** m_ptr;
	int m_size;
	int m_allocated;
public:
	Vector(){Init();}
	int GetSize(){return m_size;}
	void Ensure_Capacity(int a_size);
	void Init();
	Vector * Create();
	void Clear();
	VectorData * Get(int const & a_index) const;
	void Set(int a_index,int a_DataType,void * a_value);
	const int Index_Of(void * a_value);
	void Add(int a_DataType,void * a_value);
	void Remove_by_Value(void * a_value);
	void Sort();
	bool Empty();
	void Insert(int a_index,void * a_value,int a_DataType);
	void Add_Vector(Vector * V);
};